<?php
/**
 * This file is form http://findcat.cn
 *
 * @link     https://findcat.cn
 * @email    1476982312@qq.com
 */
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserOathsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('user_oaths', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('user_id');
            $table->string('unionid')->nullable()->comment('unionid');
            $table->string('nickname')->nullable()->comment('昵称');
            $table->string('name')->nullable()->comment('描述');
            $table->string('email')->nullable()->comment('邮箱');
            $table->string('avatar')->nullable()->comment('头像');
            $table->jsonb('original')->comment('详细信息');
            $table->string('token')->comment('token');
            $table->string('provider')->comment('来源');
            $table->timestamps();
            $table->index('user_id');
            $table->index('token');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('user_oaths');
    }
}
